Skip to content

Conversation

@Superjomn
Copy link
Collaborator

@Superjomn Superjomn commented Oct 28, 2025

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fix the random hang issue
      • Fix the ZeroMqQueue.get_nonblock_async, which may lose some messages
      • Move all the socket operations to a central thread to avoid the zmq thread-safe issue
    • Improved RPC startup reliability with enhanced event loop initialization and timing adjustments.
    • Enhanced shutdown behavior to properly cancel pending requests instead of waiting indefinitely.
    • Better error handling and logging across RPC communication layers.
  • Tests

    • Enabled additional test coverage to ensure improved reliability of RPC functionality.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@Superjomn Superjomn requested a review from a team as a code owner October 28, 2025 06:11
@Superjomn Superjomn requested a review from hchings October 28, 2025 06:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

📝 Walkthrough

Walkthrough

RPC infrastructure hardening for resilience and graceful shutdown. Changes include immediate shutdown with request cancellation semantics, improved event loop startup reliability via increased delays and synchronization, centralized error handling helpers, and removal of test waivers with enhanced resource cleanup patterns.

Changes

Cohort / File(s) Summary
RPC Client Startup Resilience
tensorrt_llm/executor/rpc/rpc_client.py
Increased initial sleep delays (0.1s → 0.2s) in _ensure_event_loop and run_loop(). Added lazy response reader startup with non-blocking deferral and try/except around loop-start logic to prevent exception propagation.
RPC Server Shutdown & Cancellation
tensorrt_llm/executor/rpc/rpc_server.py
Changed shutdown to immediate cancellation instead of waiting for pending work. Added internal helpers: _cancel_pending_queue_requests, _send_error_response, _handle_shutdown_request. Integrated RPCCancelled checks before and during request processing; streaming requests trigger cancellation on shutdown detection. Updated error handling to differentiate streaming vs. non-streaming responses.
RPC Proxy Synchronization & Robustness
tensorrt_llm/executor/rpc_proxy.py
Added main_loop_started Event for synchronization; early response reader startup with explicit readiness check. Wrapped RPC submission with try/except for _results cleanup. Enhanced shutdown robustness via hasattr checks and exception handling around MPI session, RPC client close, and main loop cancellation with timeout-based thread join. Simplified main loop task composition.
Test Resource Cleanup & Skip Removal
tests/unittest/executor/test_rpc.py, tests/unittest/executor/test_rpc_proxy.py, tests/unittest/executor/test_rpc_worker.py
Replaced context-managed client/server cleanup with explicit construction, try/finally blocks, and ordered shutdown/close sequences. Updated test assertions to expect RPCCancelled behavior on shutdown. Removed skip decorators to enable previously skipped tests; added skip marker for flaky performance test. Changed address generation to unique IPC addresses.
Test Waivers Reduction
tests/integration/test_lists/waives.txt
Removed multiple SKIP entries for tests under unittest/executor and unittest/llmapi, reducing waived test exclusions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    participant Queue
    participant Worker

    note over Client,Worker: Normal Request Processing Flow
    Client->>Server: submit_request(req)
    Server->>Server: _handle_shutdown_request()
    alt Shutdown Active
        Server->>Queue: cancel pending requests
        Server->>Client: send RPCCancelled error
    else Normal Path
        Server->>Worker: process_request()
        Worker-->>Server: response
        Server->>Client: send_response()
    end

    note over Client,Worker: Shutdown Initiated
    Client->>Server: shutdown()
    Server->>Queue: _cancel_pending_queue_requests()
    activate Queue
    loop For each pending request
        Queue->>Client: send RPCCancelled error
    end
    deactivate Queue
    Server->>Worker: executor.shutdown(wait=False)
    Server->>Server: cancel main_loop task
    Server->>Server: stop event loop
Loading
sequenceDiagram
    participant Caller
    participant Proxy
    participant EventLoop
    participant Client

    note over Caller,Client: RPC Proxy Initialization with Sync
    Caller->>Proxy: __init__()
    Proxy->>Proxy: create main_loop_started Event
    Proxy->>Client: start_response_reader()
    activate EventLoop
    Proxy->>EventLoop: run main_loop tasks
    rect rgb(200, 220, 255)
        note over Proxy: Main loop ready
        Proxy->>Proxy: set main_loop_started
    end
    deactivate EventLoop
    Caller->>Proxy: await main_loop_started.wait(timeout)
    alt Timeout
        Proxy->>Caller: raise TimeoutError
    else Ready
        Caller->>Proxy: proceed with execute()
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • rpc_server.py: Requires careful analysis of new request cancellation flow, integration of _handle_shutdown_request across all request paths, and error handling differentiation between streaming/non-streaming modes
  • rpc_proxy.py: Multiple synchronization mechanisms, shutdown robustness with error handling, and state management during initialization and cleanup
  • rpc_client.py: Timing-sensitive logic changes and lazy initialization; verify no race conditions introduced
  • Test files: Validate that new cleanup patterns properly release resources and that removed skip decorators don't mask underlying flakiness beyond the explicitly marked performance test

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 54.55% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The PR description is entirely blank except for the template placeholders; the Description and Test Coverage sections are empty, and the checklist items are not filled out. Provide a detailed description of the issue being fixed, explain the solution, list relevant test cases that validate the changes, and complete the PR checklist items.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title '[TRTLLM-9144][fix] enhance RPC robustness' clearly and specifically describes the main objective of the PR - enhancing robustness of the RPC system. This aligns with the comprehensive changes across rpc_client.py, rpc_server.py, and rpc_proxy.py that improve error handling, shutdown semantics, and event loop management.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
tensorrt_llm/executor/rpc/rpc_client.py (2)

1-8: Add NVIDIA Apache-2.0 header (2025).

Per repo guidelines, prepend the standard NVIDIA Apache-2.0 header to all .py sources.

As per coding guidelines

+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import asyncio
 import concurrent.futures
 import threading
 import time

323-327: Comment/code mismatch: apply “timeout + 1s” or update comment.

Either add 1s headroom or fix the comment. Adding headroom matches intent and avoids client timing out before server’s timeout response arrives.

-                # Add 1 second to the timeout to ensure the client can get
-                res = await asyncio.wait_for(future, timeout)
+                # Add 1 second to the timeout to ensure the client can get server error
+                res = await asyncio.wait_for(future, timeout + 1.0)
tests/unittest/executor/test_rpc.py (1)

1-6: Add NVIDIA Apache-2.0 header (2025).

Tests are also source files; prepend the header.

As per coding guidelines

+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import asyncio
 import time
tensorrt_llm/executor/rpc_proxy.py (1)

1-20: Add NVIDIA Apache-2.0 header (2025).

Prepend the standard header.

As per coding guidelines

+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import asyncio
 import atexit
tensorrt_llm/executor/rpc/rpc_server.py (1)

1-16: Add NVIDIA Apache-2.0 header (2025).

Prepend the standard header.

As per coding guidelines

+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import asyncio
 import inspect
🧹 Nitpick comments (10)
tensorrt_llm/executor/rpc/rpc_client.py (2)

254-271: Reader startup robustness: narrow exception and log stack.

Logic is good; avoid blind except Exception and log traceback for diagnosis.

-        except Exception as e:
-            logger_debug(f"Error starting response reader: {e}")
+        except (RuntimeError, asyncio.CancelledError) as e:
+            logger_debug(f"Error starting response reader: {e}")
+        except Exception:
+            logger.exception("Error starting response reader")
             # Don't raise here, let it retry on next call
             self._reader_task = None

Ruff BLE001.


359-359: Replace fixed sleep with readiness wait.

Poll is_running() with a short backoff and timeout instead of a magic 0.2s.

-            # Give the loop a moment to start
-            time.sleep(0.2)
+            # Wait for the loop to start running (max 1s)
+            waited = 0.0
+            while not self._loop.is_running() and waited < 1.0:
+                time.sleep(0.01)
+                waited += 0.01
tests/unittest/executor/test_rpc.py (4)

217-229: Test semantics: create pendings before shutdown.

This test now enqueues requests after triggering shutdown. To validate “pending requests are cancelled when server shuts down,” enqueue first, then shutdown.

-        client = RPCClient(addr)
-        try:
-            client.shutdown_server()
-            pending_futures = [client.task().remote_future() for _ in range(10)]
+        client = RPCClient(addr)
+        try:
+            pending_futures = [client.task().remote_future() for _ in range(10)]
+            client.shutdown_server()

284-297: Ensure deterministic server teardown.

After remote shutdown, explicitly call server.shutdown() locally to join the dispatcher instead of relying on sleep(1.0).

-    finally:
-        # Wait for the server dispatcher thread to quit
-        time.sleep(1.0)
+    finally:
+        # Join dispatcher deterministically
+        server.shutdown()

299-301: Track flaky test with an issue ID.

Add a reference (issue/URL) to the skip reason to avoid permanent skip.

-@pytest.mark.skip(reason="This test is flaky, need to fix it")
+@pytest.mark.skip(reason="Flaky; tracked in ISSUE-XXXX: fix perf timing nondeterminism")

375-393: Teardown order and sleeps.

Good: server first, then client. Prefer joining or polling over fixed sleep(1.0) to shorten tests and reduce flakiness.

-        # Wait longer to ensure all background threads exit completely
-        time.sleep(1.0)
+        # Optional: poll for thread shutdown instead of fixed sleep
+        # e.g., wait up to 1s in 20 * 50ms steps if available
tensorrt_llm/executor/rpc_proxy.py (4)

67-77: Avoid inner import; consider public starter.

  • Remove inner import time; use the module-level import.
  • Using a private _start_response_reader_lazily is brittle; consider exposing a public ensure_reader_started() on RPCClient later.
-        if hasattr(self.rpc_client, '_start_response_reader_lazily'):
-            self.rpc_client._start_response_reader_lazily()
-            # Give response reader time to start
-            import time
-            time.sleep(0.1)
+        if hasattr(self.rpc_client, '_start_response_reader_lazily'):
+            self.rpc_client._start_response_reader_lazily()
+            time.sleep(0.1)  # Give response reader time to start

298-320: Register result before submit; drop unused exception var and log.

  • Great race fix moving registration before send.
  • Remove unused e and log with traceback if needed.
-        except Exception as e:
+        except Exception:
             # Clean up on error
             self._results.pop(client_id, None)
-            raise
+            logger.exception("submit() failed")
+            raise

Ruff F841.


346-364: Shutdown: avoid blind except, prefer logger.exception.

Use specific exceptions where possible, or at least log stack traces.

-            except Exception as e:
-                logger.warning(f"Error during main loop shutdown: {e}")
+            except Exception:
+                logger.exception("Error during main loop shutdown")
-            except Exception as e:
-                logger.warning(f"Error during MPI session shutdown: {e}")
+            except Exception:
+                logger.exception("Error during MPI session shutdown")
-        except Exception as e:
-            logger.warning(f"Error during RPC client close: {e}")
+        except Exception:
+            logger.exception("Error during RPC client close")

Ruff BLE001.


369-373: Remove f-strings without placeholders.

Ruff F541: unnecessary f prefix.

-                logger_debug(f"Shutting down mpi session", color="yellow")
+                logger_debug("Shutting down mpi session", color="yellow")
-                logger_debug(f"Mpi session shutdown", color="yellow")
+                logger_debug("Mpi session shutdown", color="yellow")
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e36484 and 593bf70.

📒 Files selected for processing (7)
  • tensorrt_llm/executor/rpc/rpc_client.py (3 hunks)
  • tensorrt_llm/executor/rpc/rpc_server.py (12 hunks)
  • tensorrt_llm/executor/rpc_proxy.py (8 hunks)
  • tests/integration/test_lists/waives.txt (0 hunks)
  • tests/unittest/executor/test_rpc.py (5 hunks)
  • tests/unittest/executor/test_rpc_proxy.py (0 hunks)
  • tests/unittest/executor/test_rpc_worker.py (0 hunks)
💤 Files with no reviewable changes (3)
  • tests/integration/test_lists/waives.txt
  • tests/unittest/executor/test_rpc_worker.py
  • tests/unittest/executor/test_rpc_proxy.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tensorrt_llm/executor/rpc_proxy.py
  • tensorrt_llm/executor/rpc/rpc_client.py
  • tests/unittest/executor/test_rpc.py
  • tensorrt_llm/executor/rpc/rpc_server.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tensorrt_llm/executor/rpc_proxy.py
  • tensorrt_llm/executor/rpc/rpc_client.py
  • tests/unittest/executor/test_rpc.py
  • tensorrt_llm/executor/rpc/rpc_server.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tensorrt_llm/executor/rpc_proxy.py
  • tensorrt_llm/executor/rpc/rpc_client.py
  • tests/unittest/executor/test_rpc.py
  • tensorrt_llm/executor/rpc/rpc_server.py
🧬 Code graph analysis (4)
tensorrt_llm/executor/rpc_proxy.py (6)
tensorrt_llm/executor/rpc/rpc_common.py (1)
  • RPCCancelled (55-59)
tensorrt_llm/executor/rpc/rpc_client.py (2)
  • _start_response_reader_lazily (252-270)
  • close (119-157)
tensorrt_llm/executor/proxy.py (2)
  • submit (417-442)
  • shutdown (368-415)
tensorrt_llm/executor/base_worker.py (2)
  • submit (526-558)
  • shutdown (560-568)
tensorrt_llm/llmapi/utils.py (2)
  • stop (326-327)
  • logger_debug (103-116)
tensorrt_llm/llmapi/llm.py (1)
  • shutdown (743-750)
tensorrt_llm/executor/rpc/rpc_client.py (1)
tensorrt_llm/llmapi/utils.py (1)
  • logger_debug (103-116)
tests/unittest/executor/test_rpc.py (3)
tensorrt_llm/executor/rpc/rpc_client.py (5)
  • RPCClient (72-507)
  • shutdown_server (110-117)
  • remote_future (58-63)
  • close (119-157)
  • remote (44-49)
tensorrt_llm/executor/rpc/rpc_common.py (2)
  • RPCCancelled (55-59)
  • get_unique_ipc_addr (9-16)
tensorrt_llm/executor/rpc/rpc_server.py (5)
  • RPCServer (17-587)
  • bind (82-94)
  • start (558-587)
  • address (72-74)
  • shutdown (96-150)
tensorrt_llm/executor/rpc/rpc_server.py (3)
tensorrt_llm/executor/rpc/rpc_common.py (6)
  • RPCCancelled (55-59)
  • RPCError (33-48)
  • RPCRequest (67-81)
  • RPCResponse (84-90)
  • RPCStreamingError (62-63)
  • RPCTimeout (51-52)
tensorrt_llm/llmapi/utils.py (1)
  • logger_debug (103-116)
tensorrt_llm/executor/ipc.py (1)
  • put_async (163-181)
🪛 Ruff (0.14.1)
tensorrt_llm/executor/rpc_proxy.py

165-165: Avoid specifying long messages outside the exception class

(TRY003)


316-316: Local variable e is assigned to but never used

Remove assignment to unused variable e

(F841)


362-362: Do not catch blind exception: Exception

(BLE001)


369-369: f-string without any placeholders

Remove extraneous f prefix

(F541)


371-371: f-string without any placeholders

Remove extraneous f prefix

(F541)


373-373: Do not catch blind exception: Exception

(BLE001)


379-379: Do not catch blind exception: Exception

(BLE001)

tensorrt_llm/executor/rpc/rpc_client.py

267-267: Do not catch blind exception: Exception

(BLE001)

tensorrt_llm/executor/rpc/rpc_server.py

191-191: Do not catch blind exception: Exception

(BLE001)


203-203: Store a reference to the return value of asyncio.create_task

(RUF006)


462-463: Abstract raise to an inner function

(TRY301)


462-463: Avoid specifying long messages outside the exception class

(TRY003)


483-484: Abstract raise to an inner function

(TRY301)


483-484: Avoid specifying long messages outside the exception class

(TRY003)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (6)
tests/unittest/executor/test_rpc.py (1)

472-481: LGTM: validates RPCCancelled on in-flight future after shutdown.

tensorrt_llm/executor/rpc_proxy.py (2)

109-111: LGTM: handle RPCCancelled explicitly in fetch loop.


140-166: Main loop readiness signal: good; keep wait bounded.

The event-based readiness + 5s wait is solid; nothing to change.

tensorrt_llm/executor/rpc/rpc_server.py (3)

248-266: LGTM: centralized error response helper is clear and correct.


289-301: LGTM: respect shutdown in worker loop before processing.


446-485: LGTM: graceful streaming cancellation on shutdown.

Minor: Ruff TRY003 suggests moving long messages into exception types, but acceptable as-is.

@Superjomn Superjomn force-pushed the fix-rpc-unstable branch 3 times, most recently from ad92d4b to 701ff1d Compare November 5, 2025 06:09
@Superjomn Superjomn changed the title [None][fix] RPC stability [None][fix] enhance RPC Nov 5, 2025
@Superjomn
Copy link
Collaborator Author

/bot run --stage-list "A100X-PyTorch-1"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #23611 [ run ] triggered by Bot. Commit: 701ff1d

@tensorrt-cicd
Copy link
Collaborator

PR_Github #23611 [ run ] completed with state SUCCESS. Commit: 701ff1d
/LLM/main/L0_MergeRequest_PR pipeline #17765 (Partly Tested) completed with status: 'FAILURE'

@Superjomn
Copy link
Collaborator Author

/bot run --only-multi-gpu-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24156 [ run ] triggered by Bot. Commit: 864b3e1

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24156 [ run ] completed with state SUCCESS. Commit: 864b3e1
/LLM/main/L0_MergeRequest_PR pipeline #18213 (Partly Tested) completed with status: 'FAILURE'

@Superjomn
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24200 [ run ] triggered by Bot. Commit: 864b3e1

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24200 [ run ] completed with state SUCCESS. Commit: 864b3e1
/LLM/main/L0_MergeRequest_PR pipeline #18248 completed with status: 'FAILURE'

@Superjomn
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24304 [ run ] triggered by Bot. Commit: cde1bb3

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24304 [ run ] completed with state SUCCESS. Commit: cde1bb3
/LLM/main/L0_MergeRequest_PR pipeline #18335 completed with status: 'FAILURE'

@Superjomn Superjomn requested a review from a team as a code owner November 13, 2025 14:47
@Superjomn Superjomn force-pushed the fix-rpc-unstable branch 2 times, most recently from 8b34791 to 6cbded7 Compare November 13, 2025 14:48
@Superjomn Superjomn requested review from tongyuantongyu and removed request for a team November 13, 2025 14:49
@Superjomn Superjomn changed the title [None][fix] enhance RPC [None][fix] enhance RPC robustness Nov 13, 2025
@Superjomn
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25442 [ run ] triggered by Bot. Commit: 194a440

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25442 [ run ] completed with state SUCCESS. Commit: 194a440
/LLM/main/L0_MergeRequest_PR pipeline #19256 completed with status: 'FAILURE'

@Superjomn Superjomn force-pushed the fix-rpc-unstable branch 2 times, most recently from 4f48350 to d32fb43 Compare November 23, 2025 12:47
@Superjomn
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25448 [ run ] triggered by Bot. Commit: d32fb43

@Superjomn Superjomn enabled auto-merge (squash) November 23, 2025 14:37
@tensorrt-cicd
Copy link
Collaborator

PR_Github #25448 [ run ] completed with state FAILURE. Commit: d32fb43
/LLM/main/L0_MergeRequest_PR pipeline #19262 completed with status: 'FAILURE'

@Superjomn
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25468 [ run ] triggered by Bot. Commit: d32fb43

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25468 [ run ] completed with state SUCCESS. Commit: d32fb43
/LLM/main/L0_MergeRequest_PR pipeline #19282 completed with status: 'FAILURE'

@Superjomn
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25492 [ run ] triggered by Bot. Commit: d32fb43

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25492 [ run ] completed with state SUCCESS. Commit: d32fb43
/LLM/main/L0_MergeRequest_PR pipeline #19303 completed with status: 'FAILURE'

Superjomn and others added 4 commits November 24, 2025 15:42
Signed-off-by: Superjomn <[email protected]>

unwaive rpc tests

simplify RPCServer shutdown

Remove pending requests processing, shutdown immediately

fix streaming cancelled

share event_loop between proxy and client

refactor RpcClient by unifying event_loop

Simplify.

refactor RPCServer by simpify

add correctness tests

fix worker

refactor test_rpc_worker

Focus on testing the RpcWorker APIs

fix test_rpc_proxy.py

restore RPCClient with a dedicated background thread

The test_rpc_proxy.py tp1[1] passed

fix test_rpc_proxy.py

restore RPCClient with a dedicated background thread

The test_rpc_proxy.py tp1[1] passed

add threaded remote_call test

add more debugging print

dedicated thread for fetch_responses

random hang with submit failed

cleanup test_rpc.py

fix race condition in zmq socket

socket is used in both event_loop in two threads, unify the sending
in the rpc_client's main loop thread

add ipc TLLM_LLMAPI_ZMQ_DEBUG

fix wait_for lost message

test passed
the race condition is resolved completely

refine the pr

add test_ipc.py

fix tests
Signed-off-by: Superjomn <[email protected]>
Signed-off-by: Erin Ho <[email protected]>
Signed-off-by: Superjomn <[email protected]>
Signed-off-by: Yan Chunwei <[email protected]>
@Superjomn
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25518 [ run ] triggered by Bot. Commit: bab7e72

@Superjomn
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25535 [ run ] triggered by Bot. Commit: bab7e72

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25518 [ run ] completed with state ABORTED. Commit: bab7e72
LLM/main/L0_MergeRequest_PR #19324 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #25535 [ run ] completed with state SUCCESS. Commit: bab7e72
/LLM/main/L0_MergeRequest_PR pipeline #19335 completed with status: 'FAILURE'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants